import * as actionType from './constants.js';
import {reqMV,reqMVDetail} from '../../../api/index'

//主页数据

export const changeMV = (data) => {
    console.log("进去成功...............");
    return {
        type: actionType.CHANGE_MV,
        data: data
    }
}
export const changeMVDetail = (data) => {
    console.log("进去成功...............");
    return {
        type: actionType.CHANGE_MVDETAIL,
        data: data
    }
}
export const getMVDetail = (id) =>{
    return (dispatch) =>{
        reqMVDetail(id)
            .then((res) =>{
                // console.log(res,'reqPersonalized');
                dispatch(changeMVDetail(res.data.data))
            })
            .catch((e) =>{
                console.log(e,'error')
            })
    }

}

export const getMV = (page) =>{
    return (dispatch) =>{
        reqMV(page)
            .then((res) =>{
                // console.log(res,'reqPersonalized');
                dispatch(changeMV(res.data.data))
            })
            .catch((e) =>{
                console.log(e,'error')
            })
    }

}


